//
//  AWSessionMetaData.h
//  AtWork2
//
//  Created by lucas on 15/7/16.
//  Copyright (c) 2015年 Foreveross. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  会话元数据。
 */
@interface AWSessionMetaData : NSObject

@property (nonatomic, copy, readonly) NSString *host;

@property (nonatomic, assign, readonly) UInt16 port;

@property (nonatomic, copy, readonly) NSString *secret;

@property (nonatomic, copy, readwrite) NSString *username;

@property (nonatomic,copy,readwrite) NSString* tenantId;

/** 设备ID(默认为aid) **/
@property (nonatomic, strong) NSString *deviceId;

/**
 *  会话设置数据
 *
 *  @param host     地址
 *  @param port     端口
 *  @param secret   密匙
 *  @param tenanId  租户ID
 *  @param username 登录的用户名
 *
 *  @return
 */
+ (instancetype)sessionMetaDataWithHost:(NSString*)host port:(NSInteger)port secret:(NSString*)secret tenantId:(NSString*)tenanId username:(NSString*)username;

/**
 *  会话设置数据
 *
 *  @param protocolAddress 协议地址，例如socket://111.111.111.111:1234
 *  @param secret          密匙
 *  @param tenanId         租户ID
 *  @param username        登录的用户名
 *
 *  @return
 */
+(instancetype)sessionMetaDataWithProtocolAddress:(NSString*)protocolAddress secret:(NSString*)secret tenanId:(NSString*)tenanId username:(NSString*)username;

/**
 *  会话设置数据
 *
 *  @param host     地址
 *  @param port     端口
 *  @param secret   密匙
 *  @param tenanId  租户ID
 *  @param username 登录的用户名
 *
 *  @return
 */
- (instancetype)initWithHost:(NSString*)host port:(NSInteger)port secret:(NSString*)secret tenantId:(NSString*)tenanId username:(NSString*)username;

/**
 *  会话设置数据
 *
 *  @param protocolAddress 协议地址，例如socket://111.111.111.111:1234
 *  @param secret          密匙
 *  @param tenanId         租户ID
 *  @param username        登录的用户名
 *
 *  @return
 */
- (instancetype)initWithProtocolAddress:(NSString*)protocolAddress secret:(NSString*)secret tenanId:(NSString*)tenanId username:(NSString*)username;
@end
